package cn.charmaine.org.service.impl;

import cn.charmaine.basic.base.service.impl.BaseServiceImpl;
import cn.charmaine.basic.util.PageList;
import cn.charmaine.org.domain.Employee;
import cn.charmaine.org.mapper.IEmployeeMapper;
import cn.charmaine.org.query.EmployeeQuery;
import cn.charmaine.org.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {
   /* @Autowired
    private IEmployeeMapper employeeMapper;*/

   /* @Override
    @Transactional
    public void add(Employee employee) {
        employeeMapper.insert(employee);
    }

    @Override
    @Transactional
    public void deleteById(Long id) {
        employeeMapper.deleteById(id);
    }

    @Override
    @Transactional
    public void update(Employee employee) {
        employeeMapper.update(employee);
    }

    @Override
    public Employee queryById(Long id) {
        return employeeMapper.selectById(id);
    }

    @Override
    public List<Employee> queryAll() {
        return employeeMapper.selectAll();
    }

    @Override
    public PageList<Employee> queryData(EmployeeQuery query) {
        Long count = employeeMapper.count(query);
        List<Employee> rows = employeeMapper.rows(query);
        return new PageList<Employee>(count,rows);
    }

    @Override
    @Transactional
    public void batchDelete(List<Long> ids) {
        employeeMapper.batchDelete(ids);
    }*/

}
